<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>管理</title>
    <link rel="stylesheet" href="/content/pc/sysmgt/block/assets/css/style.css"/>
    <link rel="stylesheet" href="/content/pc/sysmgt/block/assets/css/layui.css">
    <link rel="stylesheet" href="/content/pc/sysmgt/block/assets/css/view.css"/>
    <link rel="stylesheet" href="/content/pc/sysmgt/block/assets/css/admin.css"/>

</head>
<style>
    body {
        background-image: linear-gradient(to bottom, #e2f2ff, #f4faff);
    }
    html, body, .app-container{
        
    }
    #lay-body {
        width: 97.7%;
        max-width: 1311px;
        margin: 0 auto;
        float: none;

    }

    .mianb .mblf {
        max-width: 1311px;
        margin: 0 auto;
        float: none;
    }

    .layui-nav {
        background: none;
        color: #000;
    }

    .layui-nav .layui-nav-item a {
        color: #000;
    }
    .table-integral{

        width: 100%;

    }
    .table-box{
        border: 1px solid #cfd5de;
        margin-top: 60px;
        border-bottom: none;
    }
    thead{
        background-color: #e2efff;
        color: rgba(0,0,0,.4);
        font-size: 14px;
    }
    thead tr th {
        padding: 4px 16px;
        border-bottom: 1px solid #e7eaef;
    }
    td{
        border-bottom: 1px solid #cfd5de;
        color: rgba(0,0,0,.9);
        height: auto;
        transition: background-color .1s linear;
        text-align: center;
        padding: 20px 5px;
    }
    tr{
        height: 40px;
        outline: 0 none;
        transition: background-color .1s linear;
    }
    td a{
        color: #006eff;
    }
    td a:hover{
        color: #006eff;
        text-decoration: underline;
    }
</style>
<body class="layui-view-body">
<div class="top">
    <div class="layui-col-md12 topbox">
      <a href="/sysadmin/block/browserkl">  <div class="layui-col-md6 logo2">
            <img src="/content/pc/sysmgt/block/assets/images/logo2.png" alt="">
          HRR跨链链浏览器
        </div></a>

        <div class="layui-col-md6">


        </div>
    </div>
</div>
<div class="layui-row" id="lay-body">

    <div class="table">
        <div class="lay-link">
            #if(type==1)
            <a href="/sysadmin/apply/getMoreApplyView" class="active">全部链卡</a>
            <a href="/sysadmin/apply/getMyApplyView">我的链卡</a>
            #else
            <a href="/sysadmin/apply/getMoreApplyView" >全部链卡</a>
            <a href="/sysadmin/apply/getMyApplyView" class="active">我的链卡</a>
            #end

        </div>
        <div class="sx">
            <div class="input">
                <input placeholder="请输入链名称" class="layui-input" value="#(search)">
            </div>
            <div class="button">
                <button class="s-btn">筛选</button>
            </div>
        </div>
        <div class="table-box">
        <table class="table-integral">
            <thead>
            <tr>
                <th scope="col">链卡名称</th>
                <th scope="col">版本号</th>
                <th scope="col">A链共识算法</th>
                <th scope="col">B链共识算法</th>
                <th scope="col">创建时间</th>
                <th scope="col">状态</th>
                <th scope="col">操作</th>
            </tr>
            </thead>
            <tbody id="content_page">
            #for(x:lklist)
            <tr>
                <td class="center">#(x.attrib_03)</td>
                <td>#(x.attrib_04)</td>
                <td>#(x.attrib_05)</td>
                <td>#(x.attrib_06)</td>
                <td>#(x.attrib_14)</td>
                <td>
                    #if(x.attrib_07=='正常')
                    <span class="badge badge-success">正常</span>
                    #else
                    <span class="badge badge-danger">异常</span>
                    #end
                </td>
                <td>
                #if(x.dy=='1')
                <a href="/sysadmin/apply/deleteDy?conflict_id=#(x.conflict_id)">删除订阅</a>
                #else
                <a href="/sysadmin/apply/addDy?conflict_id=#(x.conflict_id)">订阅</a>
                #end
                </td>
            </tr>
            #end

            </tbody>
        </table>

        </div>
        <div id="wrap" class="page_btn clear">


        </div>
        <div class="all">共<span>#(count)</span>条</div>
    </div>
</div>
<script src="/content/pc/sysmgt/block/assets/jquery.min.js"></script>
<script src="/content/pc/sysmgt/block/assets/layui.all.js"></script>
<script>
    $(function () {
        $('.sel').change(function () {    // 选择后替换内容并恢复箭头方向
            $('span').html($('.sel').find('option:selected').html());
            $('.sel_mask').find('img').attr('src', 'arrow_down.png');
        })
        $('.sel').blur(function () {      //什么也不选恢复箭头方向
            $('.sel_mask').find('img').attr('src', 'arrow_down.png');
        })
        $('.sel').click(function () {     // 点击后更改箭头方向
            $('.sel_mask').find('img').attr('src', 'arrow_up.png');
        })
    })
</script>
<script type="text/javascript">
    function Pagination($content, $wrap, options) {
        this.$wrap = $wrap;
        this.$content = $content;
        this.options = $.extend({}, Pagination.defaultOptions, options);
        this.init();
    }
    Pagination.defaultOptions = {
        size: 10
    };
    Pagination.prototype.init = function () {
        var totalItemNum = this.$content.children().length;
        var totalPageNum = this.totalPageNum = Math.ceil(totalItemNum / this.options.size);
        this.currentPage = 1;
        this.$wrap.empty();
        this.$content.children(':gt(' + (this.options.size - 1) + ')').hide();
        this.$wrap.append([
            '<span class="page_box">',
            '<a class="prev">«</a>',
            '<span class="num">',
            '</span>',
            '<a class="next">»</a>',
            '</span>'
        ].join(''));
        for (var i = 0; i < totalPageNum; i++) {
            var $btn = $('<span class="page-item">' + (i + 1) + '</span>');
            $btn.data('page', i + 1);
            this.$wrap.find('.num').append($btn);
        }
        this.$wrap.find('.num').children().eq(0).addClass('current');
        this.initEvents();
    };
    Pagination.prototype.initEvents = function () {
        var _this = this;
        var $prev = this.$wrap.find('.prev');
        var $next = this.$wrap.find('.next');
        var $num = this.$wrap.find('.num');

        $prev.on('click', function () {
            _this.prev();
        });
        $next.on('click', function () {
            _this.next();
        });
        $num.on('click', '.page-item', function () {
            var page = $(this).data('page');
            _this.goTo(page);
        });
    };
    Pagination.prototype.prev = function () {
        this.goTo(this.currentPage - 1);
    };
    Pagination.prototype.next = function () {
        this.goTo(this.currentPage + 1);
    };
    Pagination.prototype.goTo = function (num) {
        if (typeof num !== 'number') {
            throw new Error('e');
        }
        if(num > this.totalPageNum || num <= 0) {
            return false;
        }

        this.currentPage = num;

        this.$wrap.find('.num')
            .children().eq(this.currentPage - 1)
            .addClass('current').siblings('.current')
            .removeClass('current');

        var left = (this.currentPage - 1) * this.options.size;
        var right = left + this.options.size;

        var $shouldShow = this.$content.children().filter(function (index) {
            return left <= index && index < right;
        });
        this.$content.children().hide();
        $shouldShow.show();
    };

    var pagi = new Pagination($('#content_page1'), $('#wrap1'));

    var pagi = new Pagination($('#content_page'), $('#wrap'));

</script>

<script>
    $(".s-btn").click(function (){
        var val = $(".layui-input").val();
        window.open("/sysadmin/apply/getMoreApplyView?val="+val,"_self")
    })

</script>
</body>
</html>